import request from '@/utils/request'

const api = {
  creates: '/v1/auth',
  deletes: '/v1/auth',
  updates: '/v1/auth',
  query: '/v1/auth',
  order_status: '/v1/auth',
  approval_status: '/v1/auth',
}


export const getList = (tag, e) => {
  return request({
    url: api.query + '/' + tag,
    method: 'get',
    params: e
  })
}

export const add = (tag, e) => {
  return request({
    url: api.creates + '/' + tag,
    method: 'post',
    data: e
  })
}

export const edit = (tag, e, id) => {
  return request({
    url: api.updates + '/' + tag + '/' + id,
    method: 'put',
    data: e
  })
}

export const deletes = (tag, id) => {
  return request({
    url: api.creates + '/' + tag + '/' + id,
    method: 'delete',
  })
}

export const order_status = (tag, id, e) => {
  return request({
    url: api.order_status + '/' + tag + '/order_status/' + id + '/' + e,
    method: 'post',
  })
}

export const approval_status = (tag, id, e) => {
  return request({
    url: api.approval_status + '/' + tag + '/approval_status/' + id,
    method: 'post',
    data: e
  })
}